<div id="formsuccess" style="display:none">{if $errors.status == "success"}currentPage{/if}</div>
<form name="FormNews" action="?module=backoffice&action=AjaxContext&href={$href}" class="nyroModal" method="POST">
{t assignTo=title}Add an article{/t}
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalTitle.html" title=$title fullScreen=true}
<div id="modalContent" style="width: 720px; height: 600px;">
    <div id="modalTabs">
		<a class="selected" href="#" title="{t}Properties{/t}" rel="tab1"><span>{t}Properties{/t}{if isset($errors.label) || isset($errors.publicationStart)} {icon name="warning.png" size="12"}{/if}</span></a></li>
        <a href="#" title="{t}Content{/t}" rel="tab2"><span>{t}Content{/t}{if isset($errors.intro) || isset($errors.content)} {icon name="warning.png" size="12"}{/if}</span></a>
		<a href="#" title="{t}Links{/t}" rel="tab3"><span>{t}Links{/t}</span></a>
    </div>
    <div id="tab1" class="modalTab">
    <table class="listTable" >      
      <tr>
        <td><label for="form_label_label">{t}Title{/t} * : </label></td>
        <td>
        	<input type="text" id="form_label_label" name="FormNews[label]" value="{if isset($values.label)}{$values.label|escape:"html"}{/if}" style="width:550px" />
        	{if isset($errors.label)}<br /><span>{icon name="warning.png"} {$errors.label}</span>{/if}
        </td>
      </tr>
      <tr>
        <td><label for="form_label_eventDates">{t}Subtitle{/t} : </label></td>
        <td>
        	<input type="text" id="form_label_eventDates" title="{t}Subtitle - For an event, you can for example type the dates.{/t}" name="FormNews[eventDates]" value="{if isset($values.eventDates)}{$values.eventDates|escape:"html"}{/if}" style="width:550px" />
        	{if isset($errors.eventDates)}<span>{icon name="warning.png"} {$errors.eventDates}</span>{/if}
        </td>
      </tr>
      <tr>
      	<td>{t}Publication date{/t} :</td>
        <td>
        	<label for="form_label_publicationStart">{t}Start{/t} * : </label>
        	<input type="text" id="form_label_publicationStart" title="{t}Start date - Keep it empty if the news don't have start publication date, the news will be published until the end date is passed.{/t}" name="FormNews[publicationStart]" value="{if isset($values.publicationStart)}{$values.publicationStart|escape:"html"}{/if}" style="width:100px" class="dateInput" />
	        <label for="form_label_publicationEnd">{t}End{/t} : </label>
	        <input type="text" id="form_label_publicationEnd" title="{t}End date - Keep it empty if the news don't have end publication date, the news will be published once the start date is passed.{/t}" name="FormNews[publicationEnd]" value="{if isset($values.publicationEnd)}{$values.publicationEnd|escape:"html"}{/if}" style="width:100px" class="dateInput" />
        	{if isset($errors.publicationStart)}<br /><span>{icon name="warning.png"} {$errors.publicationStart}</span>{/if}
	        {if isset($errors.publicationEnd)}<span>{icon name="warning.png"} {$errors.publicationEnd}</span>{/if}
        </td>
      </tr>
      <tr><td>{t}Language{/t} :</td><td>{$newsItem->getLang()}</td></tr>
    </table>
        </div>
        <div id="tab2" style="display:none" class="modalTab">
        <table class="listTable">
      <tr>
        <td colspan="2">
        	<label for="form_label_intro">{t}Header{/t} * : </label><br /><br />
        	<textarea id="form_label_intro" style="width: 100%; height: 50px;" name="FormNews[intro]"  >{if isset($values.intro)}{$values.intro|escape:"html"}{/if}</textarea>
        	{if isset($errors.intro)}<br /><span>{icon name="warning.png"} {$errors.intro}</span><br /><br />{/if}
        </td>
      </tr>
      <tr>
        <td colspan="2">
        	<label for="form_label_content">{t}Content{/t} * : </label><br /><br />
        	<textarea id="form_label_content" style="width: 100%; height: 300px;" class="mceEditor" name="FormNews[content]"  >{if isset($values.content)}{$values.content|escape:"html"}{/if}</textarea>
        	{if isset($errors.content)}<br /><span>{icon name="warning.png"} {$errors.content}</span>{/if}
        </td>
      </tr>
    </table>
        </div>
        <div id="tab3" class="modalTab" style="display:none">
        <table class="listTable">
            <tr>
                <td><label for="form_label_picture">{t}Picture{/t} : </label></td>
                <td>
                    <input id="form_label_picture" type="hidden" name="FormNews[picture]" value="{if isset($values.picture)}{$values.picture|escape:"html"}{/if}"  />
                    <div id="image" style="margin-bottom: 5px">
                    {if $media == ""}{else}
                    <img src="{$media.src}" rel="{$media.folder->getLang()}/{$newsItem->getPictures()}" />
                    {/if}
                    </div>
                    <a href="javascript:void(0);" class="addImg itemButton itemMediaButton itemButtonLeft" title="{t}Select picture{/t}"></a>&nbsp;&nbsp;
                    <a href="javascript:void(0);" class="removeLinkedImage itemButton itemDeleteButton itemButtonLeft" {if $media == ""}style="display:none;"{/if} title="{t}Delete link{/t}"></a>
                </td>
            </tr>
    </table>
    </div>
</div>
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalFooter.html"}
</form>
